package CacheLayer;

import DomainLayer.AbstractEntity;

public class CommonCache extends AbstractCache {

	private static final long serialVersionUID = 1L;

	@Override
	public AbstractEntity getEntityFromCache(Integer id) {
		if(!containsKey(id)){
			return null;
		}
		return ((BaseFrame)get(id)).getEntity();
	}

	@Override
	public void addEntityToCache(AbstractEntity entity) {
		put(entity.getId(), new BaseFrame(entity));
	}
}
